package com.chuangjiangx.member.basic.ddd.domain.model;


/**
 * 协议：同意不同意
 */
public enum AgreementType {

    AGREE("同意", (byte) 1),
    DISAGREE("不同意", (byte) 0);

    public final String name;
    public final byte value;

    AgreementType(String name, byte value) {
        this.name = name;
        this.value = value;
    }

    public static AgreementType getAgreementType(byte value) {
        for (AgreementType type : AgreementType.values()) {
            if (type.value == value) {
                return type;
            }
        }
        return null;
    }
}
